package com.sg.business.model.dataset.project;

import com.mobnut.db.model.PrimaryObject;
import com.mongodb.DBObject;
import com.sg.business.model.IModelConstants;
import com.sg.business.model.Work;
import com.sg.widgets.commons.dataset.MasterDetailDataSetFactory;

public class ProjectDelayWork extends MasterDetailDataSetFactory {

	public ProjectDelayWork() {
		super(IModelConstants.DB, IModelConstants.C_WORK);
	}
	
	@Override
	protected PrimaryObject getDataItem(DBObject dbo) {
		Work work = (Work) super.getDataItem(dbo);
		return (!work.isProjectWBSRoot()&&work.isDelayFinish())?work:null;
	}
	
	@Override
	protected String getDetailCollectionKey() {
		return Work.F_PROJECT_ID;
	}

}
